﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QuanLySinhVien
{
    class Program
    {
        class SinhVien {
            public string hoTen;
            public string mssv;
            public byte diem;
            public string getHoTen(){
                return this.hoTen;
            }
            public void setHoTen(string ht) {
                this.hoTen = ht;
            }
            public string getMssv()
            {
                return this.mssv;
            }
            public void setMssv(string mssv)
            {
                this.mssv = mssv;
            }
            public byte getDiem()
            {
                return this.diem;
            }
            public void setDiem(byte d)
            {
                this.diem =d;
            }
            public void Nhap()
            {
                Console.Write("Ho va Ten : ");
                hoTen = Console.ReadLine();
                Console.Write("Mssv: ");
                mssv = Console.ReadLine();
                Console.Write("Diem :");
                diem = byte.Parse(Console.ReadLine());
            }
            public void xuat(int i) {
                
                Console.WriteLine(i+" \t" + mssv+ "\t   " + hoTen + "\t    " + diem);
            
            }
           
        
        
        
        
        }
        static void Main(string[] args)
        {
            int n ;
            Console.WriteLine("Hay nhap so luong sinh vien : ");
            n = int.Parse(Console.ReadLine());
            SinhVien[] sv = new SinhVien[n];
            for (int i = 0; i < n; i++) {
                sv[i] = new SinhVien();
                Console.WriteLine("Sinh vien thu " + (i + 1));
                sv[i].Nhap();
            
            }
            

            for (int i = 0; i < n; i++)
            {
                sv[i].xuat(i + 1);

            }
               byte max=sv[0].diem;
               byte min = sv[0].diem;
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < n; j++)
                        if (sv[i].diem >= max) max = sv[i].diem;
                        else min = sv[i].diem;
                
                
                }



                Console.WriteLine("diem Max =" + max+" Diem min "+min);
       


            Console.ReadLine(); 

        }
    }
}
